<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>企业管理系统</title>

    <!-- Bootstrap -->
    <link href="bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="css/list.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid clear">
    <div class="nav-menu">
        <div class="nav navbar-nav navbar-left">
            <a href="">
                企业管理系统
            </a>
        </div>
        <div class="nav navbar-nav navbar-right">
            <li class="dropdown">
                <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                    ${empty sessionScope.user.nickName ? '用户昵称未设置' : sessionScope.user.nickName }
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="users/setting.jsp">设置</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="logout#">退出</a></li>
                </ul>
            </li>
        </div>
        <div class="clear"></div>
    </div>
    <div class="back-box">
        <a href="index.jsp" class="back-btn  btn-default btn-lg">&lt;&nbsp;返&nbsp;&nbsp;回</a>
    </div>
    <div class="container content-box">
        <div class="row list-title">
            <span>员工管理</span>
        </div>
        <div class="row">
            <div class="row metal-tab-btns">
                <a type="button" class="btn btn-danger" href="">删&nbsp;&nbsp;除</a>
                <a type="button" class="btn btn-success" href="staffs/detail.jsp?type=new">添&nbsp;&nbsp;加</a>
            </div>
            <div class="row metal-tab-content">
                <table class="table table-hover table-striped">
                    <tr>
                        <td>#</td>
                        <td>编号</td>
                        <td>工号</td>
                        <td>姓名</td>
                        <td>部门</td>
                        <td>性别</td>
                        <td>出生日期</td>
                        <td>联系电话</td>
                        <td>员工状态</td>
                        <td>操作</td>
                    </tr>
                    <c:forEach var="item" items="${requestScope.DATA}" varStatus="index">
                        <tr>
                            <td>
                                <label>
                                    <input type="checkbox" class="checkbox-lg" value="${item.id}">
                                </label>
                            </td>
                            <td>${index.count}</td>
                            <td>${item.code}</td>
                            <td>${item.name}</td>
                            <td>${item.deptId}</td>
                            <td>
                                ${item.gender eq 1 ? '男' : (item.gender eq 2 ? '女' : '其它')}
                            </td>
                            <td>
                                <fmt:parseDate value="${item.birthDate}" var="fbdate" pattern="yyyy-MM-dd'T'HH:mm"/>
                                <fmt:formatDate value="${fbdate}" pattern="yyyy年MM月dd日"/>
                            </td>
                            <td>${item.tel}</td>
                            <td>
                                ${item.disable ? '正常' : '离职'}
                            </td>
                            <td>
                                <a href="staffs?type=view&id=${item.id}" class="metal-table-action metal-table-action-view">查看</a>
                                <a href="staffs?type=edit&id=${item.id}" class="metal-table-action metal-table-action-edit">修改</a>
                                <a href="staffs?type=delete&id=${item.id}" class="metal-table-action metal-table-action-del">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
            </div>
        </div>
    </div>

</div>
</body>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="${pageContext.request.contextPath}/jQuery/jquery-3.5.1.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="${pageContext.request.contextPath}/bootstrap-3.3.7/js/bootstrap.min.js"></script>
</html>